package com.lagou.homework.modulefour.third;

/*
 * @className MyThreadTest
 * @description 实现Runnable接口类的测试
 * @author admin
 * @date 2022/4/1 16:29
 * */
public class MyThreadTest {

    public static void main(String[] args) {
        // 1.创建Train类型的对象
        Train t = new Train();
        // 2.创建实现了Runnable接口的自定义类型对象
        MyThread c1 = new MyThread(t);
        // 3.使用该类型对象构造Thread类型的对象
        Thread t1 = new Thread(c1);
        Thread t2 = new Thread(c1);
        Thread t3 = new Thread(c1);
        // 4.启动线程
        t1.start();
        t2.start();
        t3.start();
    }
}
